package com.wenjie.springbootbugdetection.service.impl;

import com.wenjie.springbootbugdetection.mapper.BugMapper;
import com.wenjie.springbootbugdetection.mapper.DevelopmentMapper;
import com.wenjie.springbootbugdetection.model.Bug;
import com.wenjie.springbootbugdetection.model.Development;
import com.wenjie.springbootbugdetection.service.DevelopmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Yang wenjie
 * @date 2021/7/7 13:57
 * Nice to Meet you!
 */
@Service
public class DevelopmentServiceImpl implements DevelopmentService {
    @Autowired
    private DevelopmentMapper developmentMapper;
    @Autowired
    private BugMapper bugMapper;

    @Override
    public List<Development> select_All_Development() {
        return developmentMapper.selectAllDevelopment();
    }

    @Override
    public List<Bug> selectAllBugs(Integer statusId1, Integer statusId2, Integer modelId) {
        return bugMapper.selectAllBugs_for_development(statusId1,statusId2,modelId);
    }

    @Override
    public Development queryADevelopment(Integer id) {
       return developmentMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer deleteADevelopment(Integer id) {
        return developmentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Development selectDevelopment(Integer id) {
        return developmentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateADevelopment(Development development) {
        return developmentMapper.updateByPrimaryKeySelective(development);
    }

    @Override
    public int insertADevelopment(Development development) {
        return developmentMapper.insert(development);
    }

}
